/**
 * 岗位接口
 */

const Router = require("koa-router");
const auth = require("../middleware/auth");
const router = new Router();
const { SystemDictTypeController } = require("../controller/sys_dict_type.js");
const passport = require("koa-passport");

router.get(
  "/v1/system/dictType/list",
  passport.authenticate("jwt", { session: false }),
  auth("system:dict:query"),
  SystemDictTypeController.sysDictTypeList
);
router.post(
  "/v1/system/dictType/add",
  passport.authenticate("jwt", { session: false }),
  auth("system:dict:add"),
  SystemDictTypeController.sysDictTypeAdd
);
router.post(
  "/v1/system/dictType/delete",
  passport.authenticate("jwt", { session: false }),
  auth("system:dict:remove"),
  SystemDictTypeController.sysDictTypeDel
);
router.post(
  "/v1/system/dictType/deleteByIds",
  passport.authenticate("jwt", { session: false }),
  auth("system:dict:remove"),
  SystemDictTypeController.sysDictTypeDelByIds
);
router.put(
  "/v1/system/dictType/update",
  passport.authenticate("jwt", { session: false }),
  auth("system:dict:edit"),
  SystemDictTypeController.sysDictTypeUpd
);
router.get(
  "/v1/system/dictType/optionselect",
  passport.authenticate("jwt", { session: false }),
  auth("system:dict:query"),
  SystemDictTypeController.sysAllDictTypeList
);
router.get(
  "/v1/system/dictType/getById",
  passport.authenticate("jwt", { session: false }),
  auth("system:dict:query"),
  SystemDictTypeController.sysDictTypeById
);

router.post(
  "/v1/system/dictType/export",
  passport.authenticate("jwt", { session: false }),
  auth("system:dict:export"),
  SystemDictTypeController.sysDictTypeExport
);

module.exports = router;
